package com.songlanyun.modules.officialDonation.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;

import com.songlanyun.common.drive.RootEntity;
import com.songlanyun.common.validator.group.UpdateGroup;
import com.songlanyun.modules.donationpoints.entity.DonationPointsEntity;
import lombok.Data;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 官方捐赠
 *
 * @author wuchao
 * @email songlanyun@gmail.com
 * @date 2022-08-02 17:56:54
 */
@Data
@TableName("yxt_official_donation")
public class OfficialDonationEntity extends RootEntity<Long, OfficialDonationEntity> implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @TableId
    @NotNull(message = "主键不能为空", groups = UpdateGroup.class)
    private Long id;
    /**
     * 捐赠人ID
     */
    private Long userId;
    /**
     * 捐赠金额
     */
    @NotNull(message = "捐赠金额不能为空")
    @DecimalMin(value = "0.01", message = "捐赠金额不得少于0.01元")
    @DecimalMax(value = "999999999.99", message = "捐赠金额不得大于999999999.99元")
    private BigDecimal donationAmount;
    /**
     * 捐赠凭证
     */
    @NotBlank(message = "捐赠凭证不能为空")
    private String donationVoucher;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 审核状态（0：待审核，1：审核通过，2：审核不通过）
     */
    @NotNull(message = "审核状态不能为空", groups = UpdateGroup.class)
    private Integer auditStatus;
    /**
     * 审核人ID
     */
    private Long auditor;
    /**
     * 审核时间
     */
    private Date auditTime;
    /**
     * 支付流水号
     */
    private String serialNumber;
    /**
     * 发放数量（公益积分）
     */
    private BigDecimal issuedQuantity;

    /**
     * 申领人真实姓名
     */
    @TableField(exist = false)
    private String realName;

    /**
     * 申领人手机号
     */
    @TableField(exist = false)
    private String mobile;

    @Override
    public Long getIdentity() {
        return this.getId();
    }
}
